import unittest
from watsup.wie import WatsupIE

class ie1(unittest.TestCase):
    def setUp(self):
        self.ie=WatsupIE(useExistingIfPossible=True)
        
        
    def test_try1(self):
        self.ie.Navigate('www.google.com')
        f=self.ie.GetFormNames()[0]
        fcs=self.ie.GetFormControlNames(f)
        # control named 'q' is the text box
        self.ie.SetTextBox('WATSUP',fcs[1],f)
        self.assertEquals(self.ie.GetTextBox(fcs[1],f),'WATSUP')
        
        self.ie.ClickButton("btnI",f)
        self.assertEqual(self.ie.LocationName(),'Small Values of Cool: WATSUP')
        self.assertEqual(self.ie.LocationURL(),'http://www.brunningonline.net/simon/blog/archives/001585.html')
        
